Skip to content

fix: keep confirmation danger buttons solid in the dark theme - #303

Merged
cxymds merged 1 commit into
rustfs:mainfrom
joeyshi12:fix/dark-danger-button-fill
Nov 14, 2026
Merged

cxymds merged 1 commit into
rustfs:mainfrom
joeyshi12:fix/dark-danger-button-fill

Conversation

@joeyshi12

Copy link
Copy Markdown
Contributor

Pull Request

Description

In the dark theme, the Confirm button of delete confirmations looks disabled. These buttons combine the destructive Button variant with DANGER_BUTTON_CLASS. The variant sets dark:bg-destructive/20, and tailwind-merge keeps it because DANGER_BUTTON_CLASS only sets the unprefixed bg-destructive. So in the dark theme the button is a 20% red tint over the dialog, with the near-black --destructive-foreground label meant for a solid fill.

DANGER_BUTTON_CLASS now also sets dark:bg-destructive and dark:hover:bg-destructive/95, which replace the variant's dark tint when merged. This affects the confirmations in components/dialog-host.tsx (bucket, policy, user and other deletes) and the object delete and force cleanup dialogs in components/object/list.tsx. The light theme is unchanged.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm install --frozen-lockfile   # exit 0
pnpm type-check                  # exit 0
pnpm lint                        # exit 0
pnpm format:check                # exit 0
pnpm test:run                    # 1062 passed, 0 failed
  • New tests/lib/danger-button-dark.test.ts merges the destructive variant classes with DANGER_BUTTON_CLASS through cn and checks the dark fill and hover fill. Negative control: with the old DANGER_BUTTON_CLASS, both checks fail.
  • Chromium against a local RustFS 1.0.5, bucket delete confirmation. Dark theme Confirm background before: oklab(0.714 0.172 0.055 / 0.2) with label rgb(11, 14, 20); after: rgb(255, 107, 120) with the same label. Light theme before and after: rgb(197, 27, 50) with a white label.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

No linked issue.

Screenshots (if applicable)

Before (dark theme):

Dark delete confirmation before

After (dark theme):

Dark delete confirmation after

Additional Notes

The SSE page uses DANGER_BUTTON_CLASS on default-variant buttons, which set no dark fill, so they were not affected.

Confirmation buttons combine the destructive Button variant with DANGER_BUTTON_CLASS. The variant sets dark:bg-destructive/20, which tailwind-merge keeps because DANGER_BUTTON_CLASS only sets the unprefixed bg-destructive. In the dark theme the button was a 20% red tint with the near-black --destructive-foreground label, so it looked disabled. DANGER_BUTTON_CLASS now sets the dark fill and hover fill too.
@cxymds
cxymds merged commit 6cea668 into rustfs:main Nov 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants